<template>
    <div class="box_div">
        <h2>地域分布</h2>
        <p>数据截止2022-07-19</p>
        <div id="my_div2"></div>

    </div>
</template>

<script lang="ts">
import { defineComponent, onMounted } from 'vue'
//@ts-ignore
import * as echarts from 'echarts';
export default defineComponent({
    setup() {
        const initChartsss = () => {
            // 基于准备好的dom，初始化echarts实例
            //@ts-ignore  忽略ts检查    
            var myChart = echarts.init(document.getElementById('my_div2'));
            // 绘制图表
            myChart.setOption({

                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    top: '5%',
                },
                series: [
                    {
                        name: 'Access From',
                        type: 'pie',
                        radius: '50%',
                        data: [
                            { value: 40, name: '北京' },
                            { value: 27, name: '广西' },
                            { value: 500, name: '江苏' },
                            { value: 24, name: '上海' },
                        ],
                        emphasis: {
                            itemStyle: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            });
        }
        // 首屏
        onMounted(() => {
            initChartsss()
        })
        return {}
    }
})
</script>

<style scoped>
.box_div h2 {
    text-align: center;
    font-weight: 700;
}

.box_div p {
    text-align: center;
    font-size: 12px;
    color: rgb(133, 134, 136)
}


#my_div2 {
    width: 632px;
    height: 480px;
}
</style>